package com.example.demo.gouzaoqi;

import java.util.concurrent.CountDownLatch;

public class CountDownLatchDemo {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch count=new CountDownLatch(3);
        new Thread(()->{
            count.countDown();
        }).start();
        new Thread(()->{
            count.countDown();
        }).start();
        new Thread(()->{
            count.countDown();
        }).start();
        count.await();
        System.out.println("执行完毕");


    }
}
